package com.example.demo.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @program: demo
 * @description:
 * @author: yby
 * @create: 2020-05-20 08:59
 **/
public class DateUtil {
    /**
     * 秒转换为指定格式的日期
     * @param second
     * @param patten
     * @return
     */
    private static String secondToDate(long second,String patten) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(second * 1000);//转换为毫秒
        Date date = calendar.getTime();
        SimpleDateFormat format = new SimpleDateFormat(patten);
        String dateString = format.format(date);
        return dateString;
    }
    /**
     * 返回日时分秒
     * @param second
     * @return
     */
    private static String secondToTime(long second) {

        long days = second / 86400;//转换天数
        String day = String.valueOf(String.format("%02d", days));
        second = second % 86400;//剩余秒数
        long hours = second / 3600;//转换小时数
        String hour = String.valueOf(String.format("%02d", hours));
        second = second % 3600;//剩余秒数
        long minutes = second / 60;//转换分钟
        second = second % 60;//剩余秒数
        String minute = String.valueOf(String.format("%02d", minutes));

       /* if (0 < days){
            return days + ":"+hours+":"+minutes+":"+second;
        }else {
            return hours+":"+minutes+":"+second;
        }*/
        if (0 < days){
            return day + ":"+hour+":"+minute+":"+second;
        }else {
            return hour+":"+minute+":"+second;
        }
    }

    public static void main(String[] args) throws InterruptedException {
        //System.out.println(secondToTime(6000));
       /* int start = cn.hutool.core.date.DateUtil.second(new Date());
        Thread.sleep(5000);
        int end = cn.hutool.core.date.DateUtil.second(new Date());
        System.out.println("seconds="+(end - start));*/
        /*Calendar calendar = Calendar.getInstance();
        *//* HOUR_OF_DAY 指示一天中的小时 *//*
        calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 1);
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("一个小时前的时间：" + df.format(calendar.getTime()));
        System.out.println("当前的时间：" + df.format(new Date()));*/
      test1();
        String resultMap = "{\n" +
                "    \"data\": {\n" +
                "        \"dataList\": [\n" +
                "            {\n" +
                "                \"createdAt\": 1588742700000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21704\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1588742640000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21703\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1588742580000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21702\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1588742520000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21701\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1588742460000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21700\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1588742400000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"903.56\",\n" +
                "                    \"ZJ2load\": \"69.95\",\n" +
                "                    \"ZJ2jtom\": \"174144.38\",\n" +
                "                    \"SH2aPOW\": \"565.46\",\n" +
                "                    \"ZJ2htom\": \"105344.53\",\n" +
                "                    \"FJ1yxsj\": \"1028.88\",\n" +
                "                    \"ZJ1hylv\": \"164.67\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6329.62\",\n" +
                "                    \"FJ1jtom\": \"9291.39\",\n" +
                "                    \"FJ2yxsj\": \"1029.99\",\n" +
                "                    \"SH1aPOW\": \"551.11\",\n" +
                "                    \"ZJ2sjgl\": \"726.33\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"872.95\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.0\",\n" +
                "                    \"ZJ1sjgl\": \"727.34\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375259\",\n" +
                "                    \"SH1aRPM\": \"449.15\",\n" +
                "                    \"ZJ1htom\": \"109064.0\",\n" +
                "                    \"ZJ1jtom\": \"174198.1\",\n" +
                "                    \"FJ2htom\": \"6389.21\",\n" +
                "                    \"ZJ2hylv\": \"165.83\",\n" +
                "                    \"FJ2arpm\": \"755.29\",\n" +
                "                    \"ZJ1arpm\": \"965.18\",\n" +
                "                    \"GL1htom\": \"5717.49\",\n" +
                "                    \"SH2aRPM\": \"440.47\",\n" +
                "                    \"ZJ1load\": \"61.42\",\n" +
                "                    \"GL1jtom\": \"8857.71\",\n" +
                "                    \"FJ2jtom\": \"9299.34\",\n" +
                "                    \"WI1a002\": \"91\"\n" +
                "                },\n" +
                "                \"id\": 21699\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1587973140000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"904.13\",\n" +
                "                    \"ZJ2load\": \"68.85\",\n" +
                "                    \"ZJ2jtom\": \"174138.7\",\n" +
                "                    \"SH2aPOW\": \"567.4\",\n" +
                "                    \"ZJ2htom\": \"105342.45\",\n" +
                "                    \"FJ1yxsj\": \"1028.87\",\n" +
                "                    \"ZJ1hylv\": \"165.33\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.18\",\n" +
                "                    \"FJ1htom\": \"6327.11\",\n" +
                "                    \"FJ1jtom\": \"9288.08\",\n" +
                "                    \"FJ2yxsj\": \"1029.97\",\n" +
                "                    \"SH1aPOW\": \"561.96\",\n" +
                "                    \"ZJ2sjgl\": \"728.68\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"878.64\",\n" +
                "                    \"ZJ1yxsj\": \"926.32\",\n" +
                "                    \"WI1a001\": \"3.3\",\n" +
                "                    \"ZJ1sjgl\": \"730.14\",\n" +
                "                    \"GP1a001\": \"37.593224,121.375259\",\n" +
                "                    \"SH1aRPM\": \"444.29\",\n" +
                "                    \"ZJ1htom\": \"109061.26\",\n" +
                "                    \"ZJ1jtom\": \"174195.12\",\n" +
                "                    \"FJ2htom\": \"6386.72\",\n" +
                "                    \"ZJ2hylv\": \"167.06\",\n" +
                "                    \"FJ2arpm\": \"757.14\",\n" +
                "                    \"ZJ1arpm\": \"968.37\",\n" +
                "                    \"GL1htom\": \"5714.75\",\n" +
                "                    \"SH2aRPM\": \"445.4\",\n" +
                "                    \"ZJ1load\": \"59.83\",\n" +
                "                    \"GL1jtom\": \"8854.0\",\n" +
                "                    \"FJ2jtom\": \"9293.75\",\n" +
                "                    \"WI1a002\": \"35\"\n" +
                "                },\n" +
                "                \"id\": 21698\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1587973080000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"893.66\",\n" +
                "                    \"ZJ2load\": \"71.99\",\n" +
                "                    \"ZJ2jtom\": \"174137.15\",\n" +
                "                    \"SH2aPOW\": \"557.36\",\n" +
                "                    \"ZJ2htom\": \"105339.79\",\n" +
                "                    \"FJ1yxsj\": \"1028.86\",\n" +
                "                    \"ZJ1hylv\": \"164.33\",\n" +
                "                    \"windLevel\": \"3\",\n" +
                "                    \"ZJ2yxsj\": \"949.17\",\n" +
                "                    \"FJ1htom\": \"6325.58\",\n" +
                "                    \"FJ1jtom\": \"9284.46\",\n" +
                "                    \"FJ2yxsj\": \"1029.97\",\n" +
                "                    \"SH1aPOW\": \"559.61\",\n" +
                "                    \"ZJ2sjgl\": \"725.04\",\n" +
                "                    \"GL1yxsj\": \"500.01\",\n" +
                "                    \"ZJ2arpm\": \"867.25\",\n" +
                "                    \"ZJ1yxsj\": \"926.3\",\n" +
                "                    \"WI1a001\": \"4.2\",\n" +
                "                    \"ZJ1sjgl\": \"727.58\",\n" +
                "                    \"GP1a001\": \"37.593220,121.375267\",\n" +
                "                    \"SH1aRPM\": \"458.16\",\n" +
                "                    \"ZJ1htom\": \"109060.67\",\n" +
                "                    \"ZJ1jtom\": \"174190.98\",\n" +
                "                    \"FJ2htom\": \"6384.06\",\n" +
                "                    \"ZJ2hylv\": \"167.19\",\n" +
                "                    \"FJ2arpm\": \"755.14\",\n" +
                "                    \"ZJ1arpm\": \"934.52\",\n" +
                "                    \"GL1htom\": \"5712.73\",\n" +
                "                    \"SH2aRPM\": \"441.93\",\n" +
                "                    \"ZJ1load\": \"61.06\",\n" +
                "                    \"GL1jtom\": \"8853.02\",\n" +
                "                    \"FJ2jtom\": \"9291.86\",\n" +
                "                    \"WI1a002\": \"25\"\n" +
                "                },\n" +
                "                \"id\": 21697\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1587973020000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"888.27\",\n" +
                "                    \"ZJ2load\": \"71.09\",\n" +
                "                    \"ZJ2jtom\": \"174135.19\",\n" +
                "                    \"SH2aPOW\": \"566.36\",\n" +
                "                    \"ZJ2htom\": \"105337.09\",\n" +
                "                    \"FJ1yxsj\": \"1028.84\",\n" +
                "                    \"ZJ1hylv\": \"164.08\",\n" +
                "                    \"windLevel\": \"2\",\n" +
                "                    \"ZJ2yxsj\": \"949.17\",\n" +
                "                    \"FJ1htom\": \"6322.51\",\n" +
                "                    \"FJ1jtom\": \"9283.05\",\n" +
                "                    \"FJ2yxsj\": \"1029.96\",\n" +
                "                    \"SH1aPOW\": \"545.61\",\n" +
                "                    \"ZJ2sjgl\": \"726.05\",\n" +
                "                    \"GL1yxsj\": \"500.0\",\n" +
                "                    \"ZJ2arpm\": \"869.59\",\n" +
                "                    \"ZJ1yxsj\": \"926.29\",\n" +
                "                    \"WI1a001\": \"2.5\",\n" +
                "                    \"ZJ1sjgl\": \"727.02\",\n" +
                "                    \"GP1a001\": \"37.593239,121.375267\",\n" +
                "                    \"SH1aRPM\": \"448.24\",\n" +
                "                    \"ZJ1htom\": \"109058.09\",\n" +
                "                    \"ZJ1jtom\": \"174189.22\",\n" +
                "                    \"FJ2htom\": \"6381.92\",\n" +
                "                    \"ZJ2hylv\": \"166.65\",\n" +
                "                    \"FJ2arpm\": \"756.66\",\n" +
                "                    \"ZJ1arpm\": \"979.7\",\n" +
                "                    \"GL1htom\": \"5710.73\",\n" +
                "                    \"SH2aRPM\": \"455.19\",\n" +
                "                    \"ZJ1load\": \"58.58\",\n" +
                "                    \"GL1jtom\": \"8850.17\",\n" +
                "                    \"FJ2jtom\": \"9287.6\",\n" +
                "                    \"WI1a002\": \"14\"\n" +
                "                },\n" +
                "                \"id\": 21696\n" +
                "            },\n" +
                "            {\n" +
                "                \"createdAt\": 1587972960000,\n" +
                "                \"realValue\": {\n" +
                "                    \"FJ1arpm\": \"892.23\",\n" +
                "                    \"ZJ2load\": \"68.51\",\n" +
                "                    \"ZJ2jtom\": \"174133.26\",\n" +
                "                    \"SH2aPOW\": \"573.31\",\n" +
                "                    \"ZJ2htom\": \"105334.4\",\n" +
                "                    \"FJ1yxsj\": \"1028.82\",\n" +
                "                    \"ZJ1hylv\": \"165.22\",\n" +
                "                    \"windLevel\": \"3\",\n" +
                "                    \"ZJ2yxsj\": \"949.16\",\n" +
                "                    \"FJ1htom\": \"6320.93\",\n" +
                "                    \"FJ1jtom\": \"9279.6\",\n" +
                "                    \"FJ2yxsj\": \"1029.95\",\n" +
                "                    \"SH1aPOW\": \"551.13\",\n" +
                "                    \"ZJ2sjgl\": \"721.67\",\n" +
                "                    \"GL1yxsj\": \"500.0\",\n" +
                "                    \"ZJ2arpm\": \"834.87\",\n" +
                "                    \"ZJ1yxsj\": \"926.28\",\n" +
                "                    \"WI1a001\": \"4.0\",\n" +
                "                    \"ZJ1sjgl\": \"722.76\",\n" +
                "                    \"GP1a001\": \"37.593239,121.375267\",\n" +
                "                    \"SH1aRPM\": \"459.09\",\n" +
                "                    \"ZJ1htom\": \"109056.46\",\n" +
                "                    \"ZJ1jtom\": \"174187.91\",\n" +
                "                    \"FJ2htom\": \"6379.47\",\n" +
                "                    \"ZJ2hylv\": \"166.88\",\n" +
                "                    \"FJ2arpm\": \"769.19\",\n" +
                "                    \"ZJ1arpm\": \"933.17\",\n" +
                "                    \"GL1htom\": \"5708.57\",\n" +
                "                    \"SH2aRPM\": \"449.08\",\n" +
                "                    \"ZJ1load\": \"59.48\",\n" +
                "                    \"GL1jtom\": \"8846.49\",\n" +
                "                    \"FJ2jtom\": \"9286.63\",\n" +
                "                    \"WI1a002\": \"57\"\n" +
                "                },\n" +
                "                \"id\": 21695\n" +
                "            }\n" +
                "        ],\n" +
                "        \"page\": {\n" +
                "            \"empty\": false,\n" +
                "            \"firstResult\": 0,\n" +
                "            \"hasNext\": true,\n" +
                "            \"hasPrevious\": false,\n" +
                "            \"pageCount\": 1017,\n" +
                "            \"pageIndex\": 1,\n" +
                "            \"pageSize\": 10,\n" +
                "            \"totalCount\": 10165\n" +
                "        }\n" +
                "    },\n" +
                "    \"message\": \"成功\",\n" +
                "    \"resultCode\": \"200\"\n" +
                "}";
        JSONObject jsonObject = JSONObject.parseObject(resultMap);
        JSONObject data = jsonObject.getJSONObject("data");

        Map<String,Object> map1 = JSON.parseObject(data.toJSONString(), Map.class);
        System.out.println("map1="+map1);
        JSONArray dataList = data.getJSONArray("dataList");
        for (int i = 0; i < dataList.size(); i++) {
            jsonObject = dataList.getJSONObject(i);
            JSONObject jsonObject1 = jsonObject.getJSONObject("realValue");
            System.out.println("jsonObject1="+jsonObject1);
        }

    }

    private static void test1() {
        double a=0;
        double b = 0.0;
        double c=a+b;
        if (new BigDecimal(b).compareTo(new BigDecimal(0)) == 0){
            System.out.println("true");
        }
        System.out.println("c="+c);

        Map<String, Object> paramMap = new HashMap<>();
        paramMap.put("shipNo",111);
        paramMap.clear();
        paramMap.put("111",333);
        System.out.println("paramMap="+paramMap);

        List<Map<String,Object>> list=new ArrayList<>();
        Map<String, Object> map1 = new HashMap<>();
        map1.put("ZJ",2);
        //map1.put("ZJ2",2);
        Map<String, Object> map2 = new HashMap<>();
        map2.put("FJ",2);
        Map<String, Object> map3 = new HashMap<>();
        map3.put("GL",1);
        list.add(map1);
        list.add(map2);
        list.add(map3);
        Map<String, Object> resultMap = new HashMap<>();
        System.out.println("list="+list);
        list.forEach(data ->{
            resultMap.putAll(data);
        });

        System.out.println("resultMap="+resultMap);
        resultMap.put("id",111);
        String idd =resultMap.get("id").toString();
        System.out.println("id = "+idd);

        JSONObject  jsonObject11 = new JSONObject();
        byte avc = 2;
        jsonObject11.put("ID",avc);
        System.out.println("ID="+jsonObject11.getString("ID"));

        BigDecimal use = new BigDecimal(Double.valueOf(null == null ? 0:null)-
                Double.valueOf(null == null ? 0 :null));
        System.out.println("use="+use);

        String userBlank = "";
        String userNull = null;
        //BigDecimal aa = new BigDecimal(userBlank);
        //System.out.println("aa="+aa);
        BigDecimal bb = new BigDecimal(StringUtils.isBlank(userNull)?"0":userNull);
        System.out.println("bb="+bb);

        BigDecimal a111 = new BigDecimal (101.21);
        BigDecimal b222 = new BigDecimal (101.2);
        if(a111.compareTo(b222) > -1){
            System.out.println("a大于等于b");
        }
       /* if(a.compareTo(b) == 1){
            System.out.println("a大于b");
        }*/
        if(a111.compareTo(b222) == 1){
            System.out.println("a大于b");
        }


        List<Map<String,String>>  listaaa = new ArrayList<>();
        Map<String,String> mapTemp = new HashMap<>();
        mapTemp.put("code","code1"); // 对应预警配置表code
        mapTemp.put("deviceCode","deviceCode1"); // 对应设备表code
        mapTemp.put("name","name1");
        mapTemp.put("realValue","realValue1");
        Map<String,String> mapTemp2 = new HashMap<>();
        mapTemp2.put("code","code2"); // 对应预警配置表code
        mapTemp2.put("deviceCode","deviceCode2"); // 对应设备表code
        mapTemp2.put("name","name2");
        mapTemp2.put("realValue","realValue2");
        Map<String,String> mapTemp3 = new HashMap<>();
        mapTemp3.put("code","code3"); // 对应预警配置表code
        mapTemp3.put("deviceCode","deviceCode3"); // 对应设备表code
        mapTemp3.put("name","name3");
        mapTemp3.put("realValue","realValue3");
        listaaa.add(mapTemp);
        listaaa.add(mapTemp2);
        listaaa.add(mapTemp3);
        Map<String,Object> temp = new HashMap<>();
        temp.put("shipNo","ship001");
        temp.put("alarmList",listaaa);
        //System.out.println("temp="+temp.);



    }


}
